<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE NoImplicitPrelude
           , BangPatterns
           , NondecreasingIndentation
  #-}</span><span>
</span><span id="line-6"></span><span class="hs-pragma">{-# OPTIONS_GHC  -funbox-strict-fields #-}</span><span>
</span><span id="line-7"></span><span>
</span><span id="line-8"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Module      :  GHC.IO.Encoding.Latin1</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow, 2009</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- License     :  see libraries/base/LICENSE</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- </span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- Stability   :  internal</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- Portability :  non-portable</span><span>
</span><span id="line-17"></span><span class="hs-comment">--</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- Single-byte encodings that map directly to Unicode code points.</span><span>
</span><span id="line-19"></span><span class="hs-comment">--</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- Portions Copyright   : (c) Tom Harper 2008-2009,</span><span>
</span><span id="line-21"></span><span class="hs-comment">--                        (c) Bryan O'Sullivan 2009,</span><span>
</span><span id="line-22"></span><span class="hs-comment">--                        (c) Duncan Coutts 2009</span><span>
</span><span id="line-23"></span><span class="hs-comment">--</span><span>
</span><span id="line-24"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.IO.Encoding.Latin1</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-27"></span><span>  </span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#latin1"><span class="hs-identifier">latin1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#mkLatin1"><span class="hs-identifier">mkLatin1</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>  </span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#latin1_checked"><span class="hs-identifier">latin1_checked</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#mkLatin1_checked"><span class="hs-identifier">mkLatin1_checked</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>  </span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#ascii"><span class="hs-identifier">ascii</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#mkAscii"><span class="hs-identifier">mkAscii</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>  </span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#latin1_decode"><span class="hs-identifier">latin1_decode</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>  </span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#ascii_decode"><span class="hs-identifier">ascii_decode</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>  </span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#latin1_encode"><span class="hs-identifier">latin1_encode</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>  </span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#latin1_checked_encode"><span class="hs-identifier">latin1_checked_encode</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>  </span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#ascii_encode"><span class="hs-identifier">ascii_encode</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Real.html"><span class="hs-identifier">GHC.Real</span></a></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Num.html"><span class="hs-identifier">GHC.Num</span></a></span><span>
</span><span id="line-40"></span><span class="hs-comment">-- import GHC.IO</span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.IO.Buffer.html"><span class="hs-identifier">GHC.IO.Buffer</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Failure.html"><span class="hs-identifier">GHC.IO.Encoding.Failure</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html"><span class="hs-identifier">GHC.IO.Encoding.Types</span></a></span><span>
</span><span id="line-44"></span><span>
</span><span id="line-45"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-46"></span><span class="hs-comment">-- Latin1</span><span>
</span><span id="line-47"></span><span>
</span><span id="line-48"></span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#latin1"><span class="hs-identifier hs-type">latin1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextEncoding"><span class="hs-identifier hs-type">TextEncoding</span></a></span><span>
</span><span id="line-49"></span><span id="latin1"><span class="annot"><span class="annottext">latin1 :: TextEncoding
</span><a href="GHC.IO.Encoding.Latin1.html#latin1"><span class="hs-identifier hs-var hs-var">latin1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingFailureMode -&gt; TextEncoding
</span><a href="GHC.IO.Encoding.Latin1.html#mkLatin1"><span class="hs-identifier hs-var">mkLatin1</span></a></span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="GHC.IO.Encoding.Failure.html#ErrorOnCodingFailure"><span class="hs-identifier hs-var">ErrorOnCodingFailure</span></a></span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span class="hs-comment">-- | @since 4.4.0.0</span><span>
</span><span id="line-52"></span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#mkLatin1"><span class="hs-identifier hs-type">mkLatin1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Failure.html#CodingFailureMode"><span class="hs-identifier hs-type">CodingFailureMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextEncoding"><span class="hs-identifier hs-type">TextEncoding</span></a></span><span>
</span><span id="line-53"></span><span id="mkLatin1"><span class="annot"><span class="annottext">mkLatin1 :: CodingFailureMode -&gt; TextEncoding
</span><a href="GHC.IO.Encoding.Latin1.html#mkLatin1"><span class="hs-identifier hs-var hs-var">mkLatin1</span></a></span></span><span> </span><span id="local-6989586621679558900"><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558900"><span class="hs-identifier hs-var">cfm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TextEncoding :: forall dstate estate.
String
-&gt; IO (TextDecoder dstate)
-&gt; IO (TextEncoder estate)
-&gt; TextEncoding
</span><a href="GHC.IO.Encoding.Types.html#TextEncoding"><span class="hs-identifier hs-type">TextEncoding</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">textEncodingName :: String
</span><a href="GHC.IO.Encoding.Types.html#textEncodingName"><span class="hs-identifier hs-var">textEncodingName</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ISO-8859-1&quot;</span></span><span class="hs-special">,</span><span>
</span><span id="line-54"></span><span>                              </span><span class="annot"><span class="annottext">mkTextDecoder :: IO (TextDecoder ())
</span><a href="GHC.IO.Encoding.Types.html#mkTextDecoder"><span class="hs-identifier hs-var">mkTextDecoder</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingFailureMode -&gt; IO (TextDecoder ())
</span><a href="GHC.IO.Encoding.Latin1.html#latin1_DF"><span class="hs-identifier hs-var">latin1_DF</span></a></span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558900"><span class="hs-identifier hs-var">cfm</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-55"></span><span>                              </span><span class="annot"><span class="annottext">mkTextEncoder :: IO (TextEncoder ())
</span><a href="GHC.IO.Encoding.Types.html#mkTextEncoder"><span class="hs-identifier hs-var">mkTextEncoder</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingFailureMode -&gt; IO (TextEncoder ())
</span><a href="GHC.IO.Encoding.Latin1.html#latin1_EF"><span class="hs-identifier hs-var">latin1_EF</span></a></span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558900"><span class="hs-identifier hs-var">cfm</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-56"></span><span>
</span><span id="line-57"></span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#latin1_DF"><span class="hs-identifier hs-type">latin1_DF</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Failure.html#CodingFailureMode"><span class="hs-identifier hs-type">CodingFailureMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextDecoder"><span class="hs-identifier hs-type">TextDecoder</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-58"></span><span id="latin1_DF"><span class="annot"><span class="annottext">latin1_DF :: CodingFailureMode -&gt; IO (TextDecoder ())
</span><a href="GHC.IO.Encoding.Latin1.html#latin1_DF"><span class="hs-identifier hs-var hs-var">latin1_DF</span></a></span></span><span> </span><span id="local-6989586621679558893"><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558893"><span class="hs-identifier hs-var">cfm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-59"></span><span>  </span><span class="annot"><span class="annottext">TextDecoder () -&gt; IO (TextDecoder ())
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BufferCodec :: forall from to state.
CodeBuffer from to
-&gt; (Buffer from -&gt; Buffer to -&gt; IO (Buffer from, Buffer to))
-&gt; IO ()
-&gt; IO state
-&gt; (state -&gt; IO ())
-&gt; BufferCodec from to state
</span><a href="GHC.IO.Encoding.Types.html#BufferCodec"><span class="hs-identifier hs-type">BufferCodec</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-60"></span><span>             </span><span class="annot"><span class="annottext">encode :: CodeBuffer Word8 Char
</span><a href="GHC.IO.Encoding.Types.html#encode"><span class="hs-identifier hs-var">encode</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodeBuffer Word8 Char
</span><a href="GHC.IO.Encoding.Latin1.html#latin1_decode"><span class="hs-identifier hs-var">latin1_decode</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-61"></span><span>             </span><span class="annot"><span class="annottext">recover :: Buffer Word8 -&gt; Buffer Char -&gt; IO (Buffer Word8, Buffer Char)
</span><a href="GHC.IO.Encoding.Types.html#recover"><span class="hs-identifier hs-var">recover</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
-&gt; Buffer Word8 -&gt; Buffer Char -&gt; IO (Buffer Word8, Buffer Char)
</span><a href="GHC.IO.Encoding.Failure.html#recoverDecode"><span class="hs-identifier hs-var">recoverDecode</span></a></span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558893"><span class="hs-identifier hs-var">cfm</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-62"></span><span>             </span><span class="annot"><span class="annottext">close :: IO ()
</span><a href="GHC.IO.Encoding.Types.html#close"><span class="hs-identifier hs-var">close</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-63"></span><span>             </span><span class="annot"><span class="annottext">getState :: IO ()
</span><a href="GHC.IO.Encoding.Types.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-64"></span><span>             </span><span class="annot"><span class="annottext">setState :: () -&gt; IO ()
</span><a href="GHC.IO.Encoding.Types.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; () -&gt; IO ()
forall a b. a -&gt; b -&gt; a
</span><a href="GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; () -&gt; IO ()) -&gt; IO () -&gt; () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-65"></span><span>          </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#latin1_EF"><span class="hs-identifier hs-type">latin1_EF</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Failure.html#CodingFailureMode"><span class="hs-identifier hs-type">CodingFailureMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextEncoder"><span class="hs-identifier hs-type">TextEncoder</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-68"></span><span id="latin1_EF"><span class="annot"><span class="annottext">latin1_EF :: CodingFailureMode -&gt; IO (TextEncoder ())
</span><a href="GHC.IO.Encoding.Latin1.html#latin1_EF"><span class="hs-identifier hs-var hs-var">latin1_EF</span></a></span></span><span> </span><span id="local-6989586621679558884"><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558884"><span class="hs-identifier hs-var">cfm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-69"></span><span>  </span><span class="annot"><span class="annottext">TextEncoder () -&gt; IO (TextEncoder ())
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BufferCodec :: forall from to state.
CodeBuffer from to
-&gt; (Buffer from -&gt; Buffer to -&gt; IO (Buffer from, Buffer to))
-&gt; IO ()
-&gt; IO state
-&gt; (state -&gt; IO ())
-&gt; BufferCodec from to state
</span><a href="GHC.IO.Encoding.Types.html#BufferCodec"><span class="hs-identifier hs-type">BufferCodec</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-70"></span><span>             </span><span class="annot"><span class="annottext">encode :: CodeBuffer Char Word8
</span><a href="GHC.IO.Encoding.Types.html#encode"><span class="hs-identifier hs-var">encode</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodeBuffer Char Word8
</span><a href="GHC.IO.Encoding.Latin1.html#latin1_encode"><span class="hs-identifier hs-var">latin1_encode</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-71"></span><span>             </span><span class="annot"><span class="annottext">recover :: Buffer Char -&gt; Buffer Word8 -&gt; IO (Buffer Char, Buffer Word8)
</span><a href="GHC.IO.Encoding.Types.html#recover"><span class="hs-identifier hs-var">recover</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
-&gt; Buffer Char -&gt; Buffer Word8 -&gt; IO (Buffer Char, Buffer Word8)
</span><a href="GHC.IO.Encoding.Failure.html#recoverEncode"><span class="hs-identifier hs-var">recoverEncode</span></a></span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558884"><span class="hs-identifier hs-var">cfm</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-72"></span><span>             </span><span class="annot"><span class="annottext">close :: IO ()
</span><a href="GHC.IO.Encoding.Types.html#close"><span class="hs-identifier hs-var">close</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-73"></span><span>             </span><span class="annot"><span class="annottext">getState :: IO ()
</span><a href="GHC.IO.Encoding.Types.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-74"></span><span>             </span><span class="annot"><span class="annottext">setState :: () -&gt; IO ()
</span><a href="GHC.IO.Encoding.Types.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; () -&gt; IO ()
forall a b. a -&gt; b -&gt; a
</span><a href="GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; () -&gt; IO ()) -&gt; IO () -&gt; () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-75"></span><span>          </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-76"></span><span>
</span><span id="line-77"></span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#latin1_checked"><span class="hs-identifier hs-type">latin1_checked</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextEncoding"><span class="hs-identifier hs-type">TextEncoding</span></a></span><span>
</span><span id="line-78"></span><span id="latin1_checked"><span class="annot"><span class="annottext">latin1_checked :: TextEncoding
</span><a href="GHC.IO.Encoding.Latin1.html#latin1_checked"><span class="hs-identifier hs-var hs-var">latin1_checked</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingFailureMode -&gt; TextEncoding
</span><a href="GHC.IO.Encoding.Latin1.html#mkLatin1_checked"><span class="hs-identifier hs-var">mkLatin1_checked</span></a></span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="GHC.IO.Encoding.Failure.html#ErrorOnCodingFailure"><span class="hs-identifier hs-var">ErrorOnCodingFailure</span></a></span><span>
</span><span id="line-79"></span><span>
</span><span id="line-80"></span><span class="hs-comment">-- | @since 4.4.0.0</span><span>
</span><span id="line-81"></span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#mkLatin1_checked"><span class="hs-identifier hs-type">mkLatin1_checked</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Failure.html#CodingFailureMode"><span class="hs-identifier hs-type">CodingFailureMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextEncoding"><span class="hs-identifier hs-type">TextEncoding</span></a></span><span>
</span><span id="line-82"></span><span id="mkLatin1_checked"><span class="annot"><span class="annottext">mkLatin1_checked :: CodingFailureMode -&gt; TextEncoding
</span><a href="GHC.IO.Encoding.Latin1.html#mkLatin1_checked"><span class="hs-identifier hs-var hs-var">mkLatin1_checked</span></a></span></span><span> </span><span id="local-6989586621679558882"><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558882"><span class="hs-identifier hs-var">cfm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TextEncoding :: forall dstate estate.
String
-&gt; IO (TextDecoder dstate)
-&gt; IO (TextEncoder estate)
-&gt; TextEncoding
</span><a href="GHC.IO.Encoding.Types.html#TextEncoding"><span class="hs-identifier hs-type">TextEncoding</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">textEncodingName :: String
</span><a href="GHC.IO.Encoding.Types.html#textEncodingName"><span class="hs-identifier hs-var">textEncodingName</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ISO-8859-1&quot;</span></span><span class="hs-special">,</span><span>
</span><span id="line-83"></span><span>                                      </span><span class="annot"><span class="annottext">mkTextDecoder :: IO (TextDecoder ())
</span><a href="GHC.IO.Encoding.Types.html#mkTextDecoder"><span class="hs-identifier hs-var">mkTextDecoder</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingFailureMode -&gt; IO (TextDecoder ())
</span><a href="GHC.IO.Encoding.Latin1.html#latin1_DF"><span class="hs-identifier hs-var">latin1_DF</span></a></span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558882"><span class="hs-identifier hs-var">cfm</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-84"></span><span>                                      </span><span class="annot"><span class="annottext">mkTextEncoder :: IO (TextEncoder ())
</span><a href="GHC.IO.Encoding.Types.html#mkTextEncoder"><span class="hs-identifier hs-var">mkTextEncoder</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingFailureMode -&gt; IO (TextEncoder ())
</span><a href="GHC.IO.Encoding.Latin1.html#latin1_checked_EF"><span class="hs-identifier hs-var">latin1_checked_EF</span></a></span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558882"><span class="hs-identifier hs-var">cfm</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-85"></span><span>
</span><span id="line-86"></span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#latin1_checked_EF"><span class="hs-identifier hs-type">latin1_checked_EF</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Failure.html#CodingFailureMode"><span class="hs-identifier hs-type">CodingFailureMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextEncoder"><span class="hs-identifier hs-type">TextEncoder</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-87"></span><span id="latin1_checked_EF"><span class="annot"><span class="annottext">latin1_checked_EF :: CodingFailureMode -&gt; IO (TextEncoder ())
</span><a href="GHC.IO.Encoding.Latin1.html#latin1_checked_EF"><span class="hs-identifier hs-var hs-var">latin1_checked_EF</span></a></span></span><span> </span><span id="local-6989586621679558880"><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558880"><span class="hs-identifier hs-var">cfm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-88"></span><span>  </span><span class="annot"><span class="annottext">TextEncoder () -&gt; IO (TextEncoder ())
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BufferCodec :: forall from to state.
CodeBuffer from to
-&gt; (Buffer from -&gt; Buffer to -&gt; IO (Buffer from, Buffer to))
-&gt; IO ()
-&gt; IO state
-&gt; (state -&gt; IO ())
-&gt; BufferCodec from to state
</span><a href="GHC.IO.Encoding.Types.html#BufferCodec"><span class="hs-identifier hs-type">BufferCodec</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-89"></span><span>             </span><span class="annot"><span class="annottext">encode :: CodeBuffer Char Word8
</span><a href="GHC.IO.Encoding.Types.html#encode"><span class="hs-identifier hs-var">encode</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodeBuffer Char Word8
</span><a href="GHC.IO.Encoding.Latin1.html#latin1_checked_encode"><span class="hs-identifier hs-var">latin1_checked_encode</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-90"></span><span>             </span><span class="annot"><span class="annottext">recover :: Buffer Char -&gt; Buffer Word8 -&gt; IO (Buffer Char, Buffer Word8)
</span><a href="GHC.IO.Encoding.Types.html#recover"><span class="hs-identifier hs-var">recover</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
-&gt; Buffer Char -&gt; Buffer Word8 -&gt; IO (Buffer Char, Buffer Word8)
</span><a href="GHC.IO.Encoding.Failure.html#recoverEncode"><span class="hs-identifier hs-var">recoverEncode</span></a></span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558880"><span class="hs-identifier hs-var">cfm</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-91"></span><span>             </span><span class="annot"><span class="annottext">close :: IO ()
</span><a href="GHC.IO.Encoding.Types.html#close"><span class="hs-identifier hs-var">close</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-92"></span><span>             </span><span class="annot"><span class="annottext">getState :: IO ()
</span><a href="GHC.IO.Encoding.Types.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-93"></span><span>             </span><span class="annot"><span class="annottext">setState :: () -&gt; IO ()
</span><a href="GHC.IO.Encoding.Types.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; () -&gt; IO ()
forall a b. a -&gt; b -&gt; a
</span><a href="GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; () -&gt; IO ()) -&gt; IO () -&gt; () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-94"></span><span>          </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-97"></span><span class="hs-comment">-- ASCII</span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-100"></span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#ascii"><span class="hs-identifier hs-type">ascii</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextEncoding"><span class="hs-identifier hs-type">TextEncoding</span></a></span><span>
</span><span id="line-101"></span><span id="ascii"><span class="annot"><span class="annottext">ascii :: TextEncoding
</span><a href="GHC.IO.Encoding.Latin1.html#ascii"><span class="hs-identifier hs-var hs-var">ascii</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingFailureMode -&gt; TextEncoding
</span><a href="GHC.IO.Encoding.Latin1.html#mkAscii"><span class="hs-identifier hs-var">mkAscii</span></a></span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="GHC.IO.Encoding.Failure.html#ErrorOnCodingFailure"><span class="hs-identifier hs-var">ErrorOnCodingFailure</span></a></span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-104"></span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#mkAscii"><span class="hs-identifier hs-type">mkAscii</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Failure.html#CodingFailureMode"><span class="hs-identifier hs-type">CodingFailureMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextEncoding"><span class="hs-identifier hs-type">TextEncoding</span></a></span><span>
</span><span id="line-105"></span><span id="mkAscii"><span class="annot"><span class="annottext">mkAscii :: CodingFailureMode -&gt; TextEncoding
</span><a href="GHC.IO.Encoding.Latin1.html#mkAscii"><span class="hs-identifier hs-var hs-var">mkAscii</span></a></span></span><span> </span><span id="local-6989586621679558879"><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558879"><span class="hs-identifier hs-var">cfm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TextEncoding :: forall dstate estate.
String
-&gt; IO (TextDecoder dstate)
-&gt; IO (TextEncoder estate)
-&gt; TextEncoding
</span><a href="GHC.IO.Encoding.Types.html#TextEncoding"><span class="hs-identifier hs-type">TextEncoding</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">textEncodingName :: String
</span><a href="GHC.IO.Encoding.Types.html#textEncodingName"><span class="hs-identifier hs-var">textEncodingName</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ASCII&quot;</span></span><span class="hs-special">,</span><span>
</span><span id="line-106"></span><span>                             </span><span class="annot"><span class="annottext">mkTextDecoder :: IO (TextDecoder ())
</span><a href="GHC.IO.Encoding.Types.html#mkTextDecoder"><span class="hs-identifier hs-var">mkTextDecoder</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingFailureMode -&gt; IO (TextDecoder ())
</span><a href="GHC.IO.Encoding.Latin1.html#ascii_DF"><span class="hs-identifier hs-var">ascii_DF</span></a></span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558879"><span class="hs-identifier hs-var">cfm</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-107"></span><span>                             </span><span class="annot"><span class="annottext">mkTextEncoder :: IO (TextEncoder ())
</span><a href="GHC.IO.Encoding.Types.html#mkTextEncoder"><span class="hs-identifier hs-var">mkTextEncoder</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingFailureMode -&gt; IO (TextEncoder ())
</span><a href="GHC.IO.Encoding.Latin1.html#ascii_EF"><span class="hs-identifier hs-var">ascii_EF</span></a></span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558879"><span class="hs-identifier hs-var">cfm</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-108"></span><span>
</span><span id="line-109"></span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#ascii_DF"><span class="hs-identifier hs-type">ascii_DF</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Failure.html#CodingFailureMode"><span class="hs-identifier hs-type">CodingFailureMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextDecoder"><span class="hs-identifier hs-type">TextDecoder</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-110"></span><span id="ascii_DF"><span class="annot"><span class="annottext">ascii_DF :: CodingFailureMode -&gt; IO (TextDecoder ())
</span><a href="GHC.IO.Encoding.Latin1.html#ascii_DF"><span class="hs-identifier hs-var hs-var">ascii_DF</span></a></span></span><span> </span><span id="local-6989586621679558876"><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558876"><span class="hs-identifier hs-var">cfm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-111"></span><span>  </span><span class="annot"><span class="annottext">TextDecoder () -&gt; IO (TextDecoder ())
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BufferCodec :: forall from to state.
CodeBuffer from to
-&gt; (Buffer from -&gt; Buffer to -&gt; IO (Buffer from, Buffer to))
-&gt; IO ()
-&gt; IO state
-&gt; (state -&gt; IO ())
-&gt; BufferCodec from to state
</span><a href="GHC.IO.Encoding.Types.html#BufferCodec"><span class="hs-identifier hs-type">BufferCodec</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-112"></span><span>             </span><span class="annot"><span class="annottext">encode :: CodeBuffer Word8 Char
</span><a href="GHC.IO.Encoding.Types.html#encode"><span class="hs-identifier hs-var">encode</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodeBuffer Word8 Char
</span><a href="GHC.IO.Encoding.Latin1.html#ascii_decode"><span class="hs-identifier hs-var">ascii_decode</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-113"></span><span>             </span><span class="annot"><span class="annottext">recover :: Buffer Word8 -&gt; Buffer Char -&gt; IO (Buffer Word8, Buffer Char)
</span><a href="GHC.IO.Encoding.Types.html#recover"><span class="hs-identifier hs-var">recover</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
-&gt; Buffer Word8 -&gt; Buffer Char -&gt; IO (Buffer Word8, Buffer Char)
</span><a href="GHC.IO.Encoding.Failure.html#recoverDecode"><span class="hs-identifier hs-var">recoverDecode</span></a></span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558876"><span class="hs-identifier hs-var">cfm</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-114"></span><span>             </span><span class="annot"><span class="annottext">close :: IO ()
</span><a href="GHC.IO.Encoding.Types.html#close"><span class="hs-identifier hs-var">close</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-115"></span><span>             </span><span class="annot"><span class="annottext">getState :: IO ()
</span><a href="GHC.IO.Encoding.Types.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-116"></span><span>             </span><span class="annot"><span class="annottext">setState :: () -&gt; IO ()
</span><a href="GHC.IO.Encoding.Types.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; () -&gt; IO ()
forall a b. a -&gt; b -&gt; a
</span><a href="GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; () -&gt; IO ()) -&gt; IO () -&gt; () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-117"></span><span>          </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#ascii_EF"><span class="hs-identifier hs-type">ascii_EF</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Failure.html#CodingFailureMode"><span class="hs-identifier hs-type">CodingFailureMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextEncoder"><span class="hs-identifier hs-type">TextEncoder</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-120"></span><span id="ascii_EF"><span class="annot"><span class="annottext">ascii_EF :: CodingFailureMode -&gt; IO (TextEncoder ())
</span><a href="GHC.IO.Encoding.Latin1.html#ascii_EF"><span class="hs-identifier hs-var hs-var">ascii_EF</span></a></span></span><span> </span><span id="local-6989586621679558875"><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558875"><span class="hs-identifier hs-var">cfm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-121"></span><span>  </span><span class="annot"><span class="annottext">TextEncoder () -&gt; IO (TextEncoder ())
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BufferCodec :: forall from to state.
CodeBuffer from to
-&gt; (Buffer from -&gt; Buffer to -&gt; IO (Buffer from, Buffer to))
-&gt; IO ()
-&gt; IO state
-&gt; (state -&gt; IO ())
-&gt; BufferCodec from to state
</span><a href="GHC.IO.Encoding.Types.html#BufferCodec"><span class="hs-identifier hs-type">BufferCodec</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-122"></span><span>             </span><span class="annot"><span class="annottext">encode :: CodeBuffer Char Word8
</span><a href="GHC.IO.Encoding.Types.html#encode"><span class="hs-identifier hs-var">encode</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodeBuffer Char Word8
</span><a href="GHC.IO.Encoding.Latin1.html#ascii_encode"><span class="hs-identifier hs-var">ascii_encode</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-123"></span><span>             </span><span class="annot"><span class="annottext">recover :: Buffer Char -&gt; Buffer Word8 -&gt; IO (Buffer Char, Buffer Word8)
</span><a href="GHC.IO.Encoding.Types.html#recover"><span class="hs-identifier hs-var">recover</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
-&gt; Buffer Char -&gt; Buffer Word8 -&gt; IO (Buffer Char, Buffer Word8)
</span><a href="GHC.IO.Encoding.Failure.html#recoverEncode"><span class="hs-identifier hs-var">recoverEncode</span></a></span><span> </span><span class="annot"><span class="annottext">CodingFailureMode
</span><a href="#local-6989586621679558875"><span class="hs-identifier hs-var">cfm</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-124"></span><span>             </span><span class="annot"><span class="annottext">close :: IO ()
</span><a href="GHC.IO.Encoding.Types.html#close"><span class="hs-identifier hs-var">close</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-125"></span><span>             </span><span class="annot"><span class="annottext">getState :: IO ()
</span><a href="GHC.IO.Encoding.Types.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-126"></span><span>             </span><span class="annot"><span class="annottext">setState :: () -&gt; IO ()
</span><a href="GHC.IO.Encoding.Types.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; () -&gt; IO ()
forall a b. a -&gt; b -&gt; a
</span><a href="GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; () -&gt; IO ()) -&gt; IO () -&gt; () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-127"></span><span>          </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span>
</span><span id="line-130"></span><span>
</span><span id="line-131"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-132"></span><span class="hs-comment">-- The actual decoders and encoders</span><span>
</span><span id="line-133"></span><span>
</span><span id="line-134"></span><span class="hs-comment">-- TODO: Eliminate code duplication between the checked and unchecked</span><span>
</span><span id="line-135"></span><span class="hs-comment">-- versions of the decoder or encoder (but don't change the Core!)</span><span>
</span><span id="line-136"></span><span>
</span><span id="line-137"></span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#latin1_decode"><span class="hs-identifier hs-type">latin1_decode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#DecodeBuffer"><span class="hs-identifier hs-type">DecodeBuffer</span></a></span><span>
</span><span id="line-138"></span><span id="latin1_decode"><span class="annot"><span class="annottext">latin1_decode :: CodeBuffer Word8 Char
</span><a href="GHC.IO.Encoding.Latin1.html#latin1_decode"><span class="hs-identifier hs-var hs-var">latin1_decode</span></a></span></span><span> </span><span>
</span><span id="line-139"></span><span>  </span><span id="local-6989586621679558873"><span class="annot"><span class="annottext">input :: Buffer Word8
</span><a href="#local-6989586621679558873"><span class="hs-identifier hs-var">input</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.IO.Buffer.html#Buffer"><span class="hs-identifier hs-type">Buffer</span></a></span><span class="hs-special">{</span><span>  </span><span class="annot"><span class="annottext">bufRaw :: forall e. Buffer e -&gt; RawBuffer e
</span><a href="GHC.IO.Buffer.html#bufRaw"><span class="hs-identifier hs-var">bufRaw</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558870"><span class="annot"><span class="annottext">RawBuffer Word8
</span><a href="#local-6989586621679558870"><span class="hs-identifier hs-var">iraw</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufL :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufL"><span class="hs-identifier hs-var">bufL</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558868"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558868"><span class="hs-identifier hs-var">ir0</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufR :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufR"><span class="hs-identifier hs-var">bufR</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558866"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558866"><span class="hs-identifier hs-var">iw</span></a></span></span><span class="hs-special">,</span><span>  </span><span class="annot"><span class="annottext">bufSize :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufSize"><span class="hs-identifier hs-var">bufSize</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-140"></span><span>  </span><span id="local-6989586621679558864"><span class="annot"><span class="annottext">output :: Buffer Char
</span><a href="#local-6989586621679558864"><span class="hs-identifier hs-var">output</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.IO.Buffer.html#Buffer"><span class="hs-identifier hs-type">Buffer</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">bufRaw :: forall e. Buffer e -&gt; RawBuffer e
</span><a href="GHC.IO.Buffer.html#bufRaw"><span class="hs-identifier hs-var">bufRaw</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558863"><span class="annot"><span class="annottext">RawBuffer Char
</span><a href="#local-6989586621679558863"><span class="hs-identifier hs-var">oraw</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufL :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufL"><span class="hs-identifier hs-var">bufL</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span>   </span><span class="annot"><span class="annottext">bufR :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufR"><span class="hs-identifier hs-var">bufR</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558862"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558862"><span class="hs-identifier hs-var">ow0</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufSize :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufSize"><span class="hs-identifier hs-var">bufSize</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558861"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558861"><span class="hs-identifier hs-var">os</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-141"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span>
</span><span id="line-142"></span><span>       </span><span id="local-6989586621679558847"><span class="annot"><span class="annottext">loop :: Int -&gt; Int -&gt; IO (CodingProgress, Buffer Word8, Buffer Char)
</span><a href="#local-6989586621679558847"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679558846"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558846"><span class="hs-identifier hs-var">ir</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679558845"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558845"><span class="hs-identifier hs-var">ow</span></a></span></span><span>
</span><span id="line-143"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558845"><span class="hs-identifier hs-var">ow</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558861"><span class="hs-identifier hs-var">os</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingProgress
-&gt; Int -&gt; Int -&gt; IO (CodingProgress, Buffer Word8, Buffer Char)
forall {m :: * -&gt; *} {a}.
Monad m =&gt;
a -&gt; Int -&gt; Int -&gt; m (a, Buffer Word8, Buffer Char)
</span><a href="#local-6989586621679558844"><span class="hs-identifier hs-var">done</span></a></span><span> </span><span class="annot"><span class="annottext">CodingProgress
</span><a href="GHC.IO.Encoding.Types.html#OutputUnderflow"><span class="hs-identifier hs-var">OutputUnderflow</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558846"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558845"><span class="hs-identifier hs-var">ow</span></a></span><span>
</span><span id="line-144"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558846"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558866"><span class="hs-identifier hs-var">iw</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingProgress
-&gt; Int -&gt; Int -&gt; IO (CodingProgress, Buffer Word8, Buffer Char)
forall {m :: * -&gt; *} {a}.
Monad m =&gt;
a -&gt; Int -&gt; Int -&gt; m (a, Buffer Word8, Buffer Char)
</span><a href="#local-6989586621679558844"><span class="hs-identifier hs-var">done</span></a></span><span> </span><span class="annot"><span class="annottext">CodingProgress
</span><a href="GHC.IO.Encoding.Types.html#InputUnderflow"><span class="hs-identifier hs-var">InputUnderflow</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558846"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558845"><span class="hs-identifier hs-var">ow</span></a></span><span>
</span><span id="line-145"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-146"></span><span>              </span><span id="local-6989586621679558841"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679558841"><span class="hs-identifier hs-var">c0</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RawBuffer Word8 -&gt; Int -&gt; IO Word8
</span><a href="GHC.IO.Buffer.html#readWord8Buf"><span class="hs-identifier hs-var">readWord8Buf</span></a></span><span> </span><span class="annot"><span class="annottext">RawBuffer Word8
</span><a href="#local-6989586621679558870"><span class="hs-identifier hs-var">iraw</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558846"><span class="hs-identifier hs-var">ir</span></a></span><span>
</span><span id="line-147"></span><span>              </span><span id="local-6989586621679558839"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558839"><span class="hs-identifier hs-var">ow'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RawBuffer Char -&gt; Int -&gt; Char -&gt; IO Int
</span><a href="GHC.IO.Buffer.html#writeCharBuf"><span class="hs-identifier hs-var">writeCharBuf</span></a></span><span> </span><span class="annot"><span class="annottext">RawBuffer Char
</span><a href="#local-6989586621679558863"><span class="hs-identifier hs-var">oraw</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558845"><span class="hs-identifier hs-var">ow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Char
</span><a href="GHC.Base.html#unsafeChr"><span class="hs-identifier hs-var">unsafeChr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679558841"><span class="hs-identifier hs-var">c0</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-148"></span><span>              </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; IO (CodingProgress, Buffer Word8, Buffer Char)
</span><a href="#local-6989586621679558847"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558846"><span class="hs-identifier hs-var">ir</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558839"><span class="hs-identifier hs-var">ow'</span></a></span><span>
</span><span id="line-149"></span><span>
</span><span id="line-150"></span><span>       </span><span class="hs-comment">-- lambda-lifted, to avoid thunks being built in the inner-loop:</span><span>
</span><span id="line-151"></span><span>       </span><span id="local-6989586621679558844"><span class="annot"><span class="annottext">done :: a -&gt; Int -&gt; Int -&gt; m (a, Buffer Word8, Buffer Char)
</span><a href="#local-6989586621679558844"><span class="hs-identifier hs-var hs-var">done</span></a></span></span><span> </span><span id="local-6989586621679558831"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679558831"><span class="hs-identifier hs-var">why</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679558830"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558830"><span class="hs-identifier hs-var">ir</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679558829"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558829"><span class="hs-identifier hs-var">ow</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a, Buffer Word8, Buffer Char) -&gt; m (a, Buffer Word8, Buffer Char)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679558831"><span class="hs-identifier hs-var">why</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-152"></span><span>                                  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558830"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558866"><span class="hs-identifier hs-var">iw</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Buffer Word8
</span><a href="#local-6989586621679558873"><span class="hs-identifier hs-var">input</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">bufL :: Int
</span><a href="GHC.IO.Buffer.html#bufL"><span class="hs-identifier hs-var">bufL</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufR :: Int
</span><a href="GHC.IO.Buffer.html#bufR"><span class="hs-identifier hs-var">bufR</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-153"></span><span>                                              </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Buffer Word8
</span><a href="#local-6989586621679558873"><span class="hs-identifier hs-var">input</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">bufL :: Int
</span><a href="GHC.IO.Buffer.html#bufL"><span class="hs-identifier hs-var">bufL</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558830"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span>
</span><span id="line-154"></span><span>                                  </span><span class="annot"><span class="annottext">Buffer Char
</span><a href="#local-6989586621679558864"><span class="hs-identifier hs-var">output</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">bufR :: Int
</span><a href="GHC.IO.Buffer.html#bufR"><span class="hs-identifier hs-var">bufR</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558829"><span class="hs-identifier hs-var">ow</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-155"></span><span>    </span><span class="hs-keyword">in</span><span>
</span><span id="line-156"></span><span>    </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; IO (CodingProgress, Buffer Word8, Buffer Char)
</span><a href="#local-6989586621679558847"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558868"><span class="hs-identifier hs-var">ir0</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558862"><span class="hs-identifier hs-var">ow0</span></a></span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#ascii_decode"><span class="hs-identifier hs-type">ascii_decode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#DecodeBuffer"><span class="hs-identifier hs-type">DecodeBuffer</span></a></span><span>
</span><span id="line-159"></span><span id="ascii_decode"><span class="annot"><span class="annottext">ascii_decode :: CodeBuffer Word8 Char
</span><a href="GHC.IO.Encoding.Latin1.html#ascii_decode"><span class="hs-identifier hs-var hs-var">ascii_decode</span></a></span></span><span>
</span><span id="line-160"></span><span>  </span><span id="local-6989586621679558828"><span class="annot"><span class="annottext">input :: Buffer Word8
</span><a href="#local-6989586621679558828"><span class="hs-identifier hs-var">input</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.IO.Buffer.html#Buffer"><span class="hs-identifier hs-type">Buffer</span></a></span><span class="hs-special">{</span><span>  </span><span class="annot"><span class="annottext">bufRaw :: forall e. Buffer e -&gt; RawBuffer e
</span><a href="GHC.IO.Buffer.html#bufRaw"><span class="hs-identifier hs-var">bufRaw</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558827"><span class="annot"><span class="annottext">RawBuffer Word8
</span><a href="#local-6989586621679558827"><span class="hs-identifier hs-var">iraw</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufL :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufL"><span class="hs-identifier hs-var">bufL</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558826"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558826"><span class="hs-identifier hs-var">ir0</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufR :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufR"><span class="hs-identifier hs-var">bufR</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558825"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558825"><span class="hs-identifier hs-var">iw</span></a></span></span><span class="hs-special">,</span><span>  </span><span class="annot"><span class="annottext">bufSize :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufSize"><span class="hs-identifier hs-var">bufSize</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-161"></span><span>  </span><span id="local-6989586621679558824"><span class="annot"><span class="annottext">output :: Buffer Char
</span><a href="#local-6989586621679558824"><span class="hs-identifier hs-var">output</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.IO.Buffer.html#Buffer"><span class="hs-identifier hs-type">Buffer</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">bufRaw :: forall e. Buffer e -&gt; RawBuffer e
</span><a href="GHC.IO.Buffer.html#bufRaw"><span class="hs-identifier hs-var">bufRaw</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558823"><span class="annot"><span class="annottext">RawBuffer Char
</span><a href="#local-6989586621679558823"><span class="hs-identifier hs-var">oraw</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufL :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufL"><span class="hs-identifier hs-var">bufL</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span>   </span><span class="annot"><span class="annottext">bufR :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufR"><span class="hs-identifier hs-var">bufR</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558822"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558822"><span class="hs-identifier hs-var">ow0</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufSize :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufSize"><span class="hs-identifier hs-var">bufSize</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558821"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558821"><span class="hs-identifier hs-var">os</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-162"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-163"></span><span>       </span><span id="local-6989586621679558806"><span class="annot"><span class="annottext">loop :: Int -&gt; Int -&gt; IO (CodingProgress, Buffer Word8, Buffer Char)
</span><a href="#local-6989586621679558806"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679558805"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558805"><span class="hs-identifier hs-var">ir</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679558804"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558804"><span class="hs-identifier hs-var">ow</span></a></span></span><span>
</span><span id="line-164"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558804"><span class="hs-identifier hs-var">ow</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558821"><span class="hs-identifier hs-var">os</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingProgress
-&gt; Int -&gt; Int -&gt; IO (CodingProgress, Buffer Word8, Buffer Char)
forall {m :: * -&gt; *} {a}.
Monad m =&gt;
a -&gt; Int -&gt; Int -&gt; m (a, Buffer Word8, Buffer Char)
</span><a href="#local-6989586621679558803"><span class="hs-identifier hs-var">done</span></a></span><span> </span><span class="annot"><span class="annottext">CodingProgress
</span><a href="GHC.IO.Encoding.Types.html#OutputUnderflow"><span class="hs-identifier hs-var">OutputUnderflow</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558805"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558804"><span class="hs-identifier hs-var">ow</span></a></span><span>
</span><span id="line-165"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558805"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558825"><span class="hs-identifier hs-var">iw</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingProgress
-&gt; Int -&gt; Int -&gt; IO (CodingProgress, Buffer Word8, Buffer Char)
forall {m :: * -&gt; *} {a}.
Monad m =&gt;
a -&gt; Int -&gt; Int -&gt; m (a, Buffer Word8, Buffer Char)
</span><a href="#local-6989586621679558803"><span class="hs-identifier hs-var">done</span></a></span><span> </span><span class="annot"><span class="annottext">CodingProgress
</span><a href="GHC.IO.Encoding.Types.html#InputUnderflow"><span class="hs-identifier hs-var">InputUnderflow</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558805"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558804"><span class="hs-identifier hs-var">ow</span></a></span><span>
</span><span id="line-166"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-167"></span><span>              </span><span id="local-6989586621679558802"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679558802"><span class="hs-identifier hs-var">c0</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RawBuffer Word8 -&gt; Int -&gt; IO Word8
</span><a href="GHC.IO.Buffer.html#readWord8Buf"><span class="hs-identifier hs-var">readWord8Buf</span></a></span><span> </span><span class="annot"><span class="annottext">RawBuffer Word8
</span><a href="#local-6989586621679558827"><span class="hs-identifier hs-var">iraw</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558805"><span class="hs-identifier hs-var">ir</span></a></span><span>
</span><span id="line-168"></span><span>              </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679558802"><span class="hs-identifier hs-var">c0</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E"><span class="hs-operator hs-var">&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x7f</span></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">IO (CodingProgress, Buffer Word8, Buffer Char)
</span><a href="#local-6989586621679558800"><span class="hs-identifier hs-var">invalid</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-169"></span><span>              </span><span id="local-6989586621679558799"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558799"><span class="hs-identifier hs-var">ow'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RawBuffer Char -&gt; Int -&gt; Char -&gt; IO Int
</span><a href="GHC.IO.Buffer.html#writeCharBuf"><span class="hs-identifier hs-var">writeCharBuf</span></a></span><span> </span><span class="annot"><span class="annottext">RawBuffer Char
</span><a href="#local-6989586621679558823"><span class="hs-identifier hs-var">oraw</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558804"><span class="hs-identifier hs-var">ow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Char
</span><a href="GHC.Base.html#unsafeChr"><span class="hs-identifier hs-var">unsafeChr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679558802"><span class="hs-identifier hs-var">c0</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-170"></span><span>              </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; IO (CodingProgress, Buffer Word8, Buffer Char)
</span><a href="#local-6989586621679558806"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558805"><span class="hs-identifier hs-var">ir</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558799"><span class="hs-identifier hs-var">ow'</span></a></span><span>
</span><span id="line-171"></span><span>         </span><span class="hs-keyword">where</span><span>
</span><span id="line-172"></span><span>           </span><span id="local-6989586621679558800"><span class="annot"><span class="annottext">invalid :: IO (CodingProgress, Buffer Word8, Buffer Char)
</span><a href="#local-6989586621679558800"><span class="hs-identifier hs-var hs-var">invalid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingProgress
-&gt; Int -&gt; Int -&gt; IO (CodingProgress, Buffer Word8, Buffer Char)
forall {m :: * -&gt; *} {a}.
Monad m =&gt;
a -&gt; Int -&gt; Int -&gt; m (a, Buffer Word8, Buffer Char)
</span><a href="#local-6989586621679558803"><span class="hs-identifier hs-var">done</span></a></span><span> </span><span class="annot"><span class="annottext">CodingProgress
</span><a href="GHC.IO.Encoding.Types.html#InvalidSequence"><span class="hs-identifier hs-var">InvalidSequence</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558805"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558804"><span class="hs-identifier hs-var">ow</span></a></span><span>
</span><span id="line-173"></span><span>
</span><span id="line-174"></span><span>       </span><span class="hs-comment">-- lambda-lifted, to avoid thunks being built in the inner-loop:</span><span>
</span><span id="line-175"></span><span>       </span><span id="local-6989586621679558803"><span class="annot"><span class="annottext">done :: a -&gt; Int -&gt; Int -&gt; m (a, Buffer Word8, Buffer Char)
</span><a href="#local-6989586621679558803"><span class="hs-identifier hs-var hs-var">done</span></a></span></span><span> </span><span id="local-6989586621679558793"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679558793"><span class="hs-identifier hs-var">why</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679558792"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558792"><span class="hs-identifier hs-var">ir</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679558791"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558791"><span class="hs-identifier hs-var">ow</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a, Buffer Word8, Buffer Char) -&gt; m (a, Buffer Word8, Buffer Char)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679558793"><span class="hs-identifier hs-var">why</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-176"></span><span>                                  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558792"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558825"><span class="hs-identifier hs-var">iw</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Buffer Word8
</span><a href="#local-6989586621679558828"><span class="hs-identifier hs-var">input</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">bufL :: Int
</span><a href="GHC.IO.Buffer.html#bufL"><span class="hs-identifier hs-var">bufL</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufR :: Int
</span><a href="GHC.IO.Buffer.html#bufR"><span class="hs-identifier hs-var">bufR</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-177"></span><span>                                              </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Buffer Word8
</span><a href="#local-6989586621679558828"><span class="hs-identifier hs-var">input</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">bufL :: Int
</span><a href="GHC.IO.Buffer.html#bufL"><span class="hs-identifier hs-var">bufL</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558792"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span>
</span><span id="line-178"></span><span>                                  </span><span class="annot"><span class="annottext">Buffer Char
</span><a href="#local-6989586621679558824"><span class="hs-identifier hs-var">output</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">bufR :: Int
</span><a href="GHC.IO.Buffer.html#bufR"><span class="hs-identifier hs-var">bufR</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558791"><span class="hs-identifier hs-var">ow</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-179"></span><span>    </span><span class="hs-keyword">in</span><span>
</span><span id="line-180"></span><span>    </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; IO (CodingProgress, Buffer Word8, Buffer Char)
</span><a href="#local-6989586621679558806"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558826"><span class="hs-identifier hs-var">ir0</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558822"><span class="hs-identifier hs-var">ow0</span></a></span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#latin1_encode"><span class="hs-identifier hs-type">latin1_encode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#EncodeBuffer"><span class="hs-identifier hs-type">EncodeBuffer</span></a></span><span>
</span><span id="line-183"></span><span id="latin1_encode"><span class="annot"><span class="annottext">latin1_encode :: CodeBuffer Char Word8
</span><a href="GHC.IO.Encoding.Latin1.html#latin1_encode"><span class="hs-identifier hs-var hs-var">latin1_encode</span></a></span></span><span>
</span><span id="line-184"></span><span>  </span><span id="local-6989586621679558789"><span class="annot"><span class="annottext">input :: Buffer Char
</span><a href="#local-6989586621679558789"><span class="hs-identifier hs-var">input</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.IO.Buffer.html#Buffer"><span class="hs-identifier hs-type">Buffer</span></a></span><span class="hs-special">{</span><span>  </span><span class="annot"><span class="annottext">bufRaw :: forall e. Buffer e -&gt; RawBuffer e
</span><a href="GHC.IO.Buffer.html#bufRaw"><span class="hs-identifier hs-var">bufRaw</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558788"><span class="annot"><span class="annottext">RawBuffer Char
</span><a href="#local-6989586621679558788"><span class="hs-identifier hs-var">iraw</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufL :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufL"><span class="hs-identifier hs-var">bufL</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558787"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558787"><span class="hs-identifier hs-var">ir0</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufR :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufR"><span class="hs-identifier hs-var">bufR</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558786"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558786"><span class="hs-identifier hs-var">iw</span></a></span></span><span class="hs-special">,</span><span>  </span><span class="annot"><span class="annottext">bufSize :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufSize"><span class="hs-identifier hs-var">bufSize</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-185"></span><span>  </span><span id="local-6989586621679558785"><span class="annot"><span class="annottext">output :: Buffer Word8
</span><a href="#local-6989586621679558785"><span class="hs-identifier hs-var">output</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.IO.Buffer.html#Buffer"><span class="hs-identifier hs-type">Buffer</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">bufRaw :: forall e. Buffer e -&gt; RawBuffer e
</span><a href="GHC.IO.Buffer.html#bufRaw"><span class="hs-identifier hs-var">bufRaw</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558784"><span class="annot"><span class="annottext">RawBuffer Word8
</span><a href="#local-6989586621679558784"><span class="hs-identifier hs-var">oraw</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufL :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufL"><span class="hs-identifier hs-var">bufL</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span>   </span><span class="annot"><span class="annottext">bufR :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufR"><span class="hs-identifier hs-var">bufR</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558783"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558783"><span class="hs-identifier hs-var">ow0</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufSize :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufSize"><span class="hs-identifier hs-var">bufSize</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558782"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558782"><span class="hs-identifier hs-var">os</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-186"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-187"></span><span>      </span><span id="local-6989586621679558778"><span class="annot"><span class="annottext">done :: a -&gt; Int -&gt; Int -&gt; m (a, Buffer Char, Buffer Word8)
</span><a href="#local-6989586621679558778"><span class="hs-identifier hs-var hs-var">done</span></a></span></span><span> </span><span id="local-6989586621679558777"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679558777"><span class="hs-identifier hs-var">why</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679558776"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558776"><span class="hs-identifier hs-var">ir</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679558775"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558775"><span class="hs-identifier hs-var">ow</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a, Buffer Char, Buffer Word8) -&gt; m (a, Buffer Char, Buffer Word8)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679558777"><span class="hs-identifier hs-var">why</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-188"></span><span>                                 </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558776"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558786"><span class="hs-identifier hs-var">iw</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Buffer Char
</span><a href="#local-6989586621679558789"><span class="hs-identifier hs-var">input</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">bufL :: Int
</span><a href="GHC.IO.Buffer.html#bufL"><span class="hs-identifier hs-var">bufL</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufR :: Int
</span><a href="GHC.IO.Buffer.html#bufR"><span class="hs-identifier hs-var">bufR</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-189"></span><span>                                             </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Buffer Char
</span><a href="#local-6989586621679558789"><span class="hs-identifier hs-var">input</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">bufL :: Int
</span><a href="GHC.IO.Buffer.html#bufL"><span class="hs-identifier hs-var">bufL</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558776"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span>
</span><span id="line-190"></span><span>                                 </span><span class="annot"><span class="annottext">Buffer Word8
</span><a href="#local-6989586621679558785"><span class="hs-identifier hs-var">output</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">bufR :: Int
</span><a href="GHC.IO.Buffer.html#bufR"><span class="hs-identifier hs-var">bufR</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558775"><span class="hs-identifier hs-var">ow</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-191"></span><span>      </span><span id="local-6989586621679558763"><span class="annot"><span class="annottext">loop :: Int -&gt; Int -&gt; IO (CodingProgress, Buffer Char, Buffer Word8)
</span><a href="#local-6989586621679558763"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679558762"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558762"><span class="hs-identifier hs-var">ir</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679558761"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558761"><span class="hs-identifier hs-var">ow</span></a></span></span><span>
</span><span id="line-192"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558761"><span class="hs-identifier hs-var">ow</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558782"><span class="hs-identifier hs-var">os</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingProgress
-&gt; Int -&gt; Int -&gt; IO (CodingProgress, Buffer Char, Buffer Word8)
forall {m :: * -&gt; *} {a}.
Monad m =&gt;
a -&gt; Int -&gt; Int -&gt; m (a, Buffer Char, Buffer Word8)
</span><a href="#local-6989586621679558778"><span class="hs-identifier hs-var">done</span></a></span><span> </span><span class="annot"><span class="annottext">CodingProgress
</span><a href="GHC.IO.Encoding.Types.html#OutputUnderflow"><span class="hs-identifier hs-var">OutputUnderflow</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558762"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558761"><span class="hs-identifier hs-var">ow</span></a></span><span>
</span><span id="line-193"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558762"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558786"><span class="hs-identifier hs-var">iw</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingProgress
-&gt; Int -&gt; Int -&gt; IO (CodingProgress, Buffer Char, Buffer Word8)
forall {m :: * -&gt; *} {a}.
Monad m =&gt;
a -&gt; Int -&gt; Int -&gt; m (a, Buffer Char, Buffer Word8)
</span><a href="#local-6989586621679558778"><span class="hs-identifier hs-var">done</span></a></span><span> </span><span class="annot"><span class="annottext">CodingProgress
</span><a href="GHC.IO.Encoding.Types.html#InputUnderflow"><span class="hs-identifier hs-var">InputUnderflow</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558762"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558761"><span class="hs-identifier hs-var">ow</span></a></span><span>
</span><span id="line-194"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-195"></span><span>           </span><span class="hs-special">(</span><span id="local-6989586621679558760"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679558760"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679558759"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558759"><span class="hs-identifier hs-var">ir'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RawBuffer Char -&gt; Int -&gt; IO (Char, Int)
</span><a href="GHC.IO.Buffer.html#readCharBuf"><span class="hs-identifier hs-var">readCharBuf</span></a></span><span> </span><span class="annot"><span class="annottext">RawBuffer Char
</span><a href="#local-6989586621679558788"><span class="hs-identifier hs-var">iraw</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558762"><span class="hs-identifier hs-var">ir</span></a></span><span>
</span><span id="line-196"></span><span>           </span><span class="annot"><span class="annottext">RawBuffer Word8 -&gt; Int -&gt; Word8 -&gt; IO ()
</span><a href="GHC.IO.Buffer.html#writeWord8Buf"><span class="hs-identifier hs-var">writeWord8Buf</span></a></span><span> </span><span class="annot"><span class="annottext">RawBuffer Word8
</span><a href="#local-6989586621679558784"><span class="hs-identifier hs-var">oraw</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558761"><span class="hs-identifier hs-var">ow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Word8
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Int
</span><a href="GHC.Base.html#ord"><span class="hs-identifier hs-var">ord</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679558760"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-197"></span><span>           </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; IO (CodingProgress, Buffer Char, Buffer Word8)
</span><a href="#local-6989586621679558763"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558759"><span class="hs-identifier hs-var">ir'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558761"><span class="hs-identifier hs-var">ow</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-198"></span><span>    </span><span class="hs-keyword">in</span><span>
</span><span id="line-199"></span><span>    </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; IO (CodingProgress, Buffer Char, Buffer Word8)
</span><a href="#local-6989586621679558763"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558787"><span class="hs-identifier hs-var">ir0</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558783"><span class="hs-identifier hs-var">ow0</span></a></span><span>
</span><span id="line-200"></span><span>
</span><span id="line-201"></span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#latin1_checked_encode"><span class="hs-identifier hs-type">latin1_checked_encode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#EncodeBuffer"><span class="hs-identifier hs-type">EncodeBuffer</span></a></span><span>
</span><span id="line-202"></span><span id="latin1_checked_encode"><span class="annot"><span class="annottext">latin1_checked_encode :: CodeBuffer Char Word8
</span><a href="GHC.IO.Encoding.Latin1.html#latin1_checked_encode"><span class="hs-identifier hs-var hs-var">latin1_checked_encode</span></a></span></span><span> </span><span id="local-6989586621679558755"><span class="annot"><span class="annottext">Buffer Char
</span><a href="#local-6989586621679558755"><span class="hs-identifier hs-var">input</span></a></span></span><span> </span><span id="local-6989586621679558754"><span class="annot"><span class="annottext">Buffer Word8
</span><a href="#local-6989586621679558754"><span class="hs-identifier hs-var">output</span></a></span></span><span>
</span><span id="line-203"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; CodeBuffer Char Word8
</span><a href="GHC.IO.Encoding.Latin1.html#single_byte_checked_encode"><span class="hs-identifier hs-var">single_byte_checked_encode</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0xff</span></span><span> </span><span class="annot"><span class="annottext">Buffer Char
</span><a href="#local-6989586621679558755"><span class="hs-identifier hs-var">input</span></a></span><span> </span><span class="annot"><span class="annottext">Buffer Word8
</span><a href="#local-6989586621679558754"><span class="hs-identifier hs-var">output</span></a></span><span>
</span><span id="line-204"></span><span>
</span><span id="line-205"></span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#ascii_encode"><span class="hs-identifier hs-type">ascii_encode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#EncodeBuffer"><span class="hs-identifier hs-type">EncodeBuffer</span></a></span><span>
</span><span id="line-206"></span><span id="ascii_encode"><span class="annot"><span class="annottext">ascii_encode :: CodeBuffer Char Word8
</span><a href="GHC.IO.Encoding.Latin1.html#ascii_encode"><span class="hs-identifier hs-var hs-var">ascii_encode</span></a></span></span><span> </span><span id="local-6989586621679558752"><span class="annot"><span class="annottext">Buffer Char
</span><a href="#local-6989586621679558752"><span class="hs-identifier hs-var">input</span></a></span></span><span> </span><span id="local-6989586621679558751"><span class="annot"><span class="annottext">Buffer Word8
</span><a href="#local-6989586621679558751"><span class="hs-identifier hs-var">output</span></a></span></span><span>
</span><span id="line-207"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; CodeBuffer Char Word8
</span><a href="GHC.IO.Encoding.Latin1.html#single_byte_checked_encode"><span class="hs-identifier hs-var">single_byte_checked_encode</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x7f</span></span><span> </span><span class="annot"><span class="annottext">Buffer Char
</span><a href="#local-6989586621679558752"><span class="hs-identifier hs-var">input</span></a></span><span> </span><span class="annot"><span class="annottext">Buffer Word8
</span><a href="#local-6989586621679558751"><span class="hs-identifier hs-var">output</span></a></span><span>
</span><span id="line-208"></span><span>
</span><span id="line-209"></span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#single_byte_checked_encode"><span class="hs-identifier hs-type">single_byte_checked_encode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#EncodeBuffer"><span class="hs-identifier hs-type">EncodeBuffer</span></a></span><span>
</span><span id="line-210"></span><span id="single_byte_checked_encode"><span class="annot"><span class="annottext">single_byte_checked_encode :: Int -&gt; CodeBuffer Char Word8
</span><a href="GHC.IO.Encoding.Latin1.html#single_byte_checked_encode"><span class="hs-identifier hs-var hs-var">single_byte_checked_encode</span></a></span></span><span> </span><span id="local-6989586621679558750"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558750"><span class="hs-identifier hs-var">max_legal_char</span></a></span></span><span>
</span><span id="line-211"></span><span>  </span><span id="local-6989586621679558749"><span class="annot"><span class="annottext">input :: Buffer Char
</span><a href="#local-6989586621679558749"><span class="hs-identifier hs-var">input</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.IO.Buffer.html#Buffer"><span class="hs-identifier hs-type">Buffer</span></a></span><span class="hs-special">{</span><span>  </span><span class="annot"><span class="annottext">bufRaw :: forall e. Buffer e -&gt; RawBuffer e
</span><a href="GHC.IO.Buffer.html#bufRaw"><span class="hs-identifier hs-var">bufRaw</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558748"><span class="annot"><span class="annottext">RawBuffer Char
</span><a href="#local-6989586621679558748"><span class="hs-identifier hs-var">iraw</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufL :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufL"><span class="hs-identifier hs-var">bufL</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558747"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558747"><span class="hs-identifier hs-var">ir0</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufR :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufR"><span class="hs-identifier hs-var">bufR</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558746"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558746"><span class="hs-identifier hs-var">iw</span></a></span></span><span class="hs-special">,</span><span>  </span><span class="annot"><span class="annottext">bufSize :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufSize"><span class="hs-identifier hs-var">bufSize</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-212"></span><span>  </span><span id="local-6989586621679558745"><span class="annot"><span class="annottext">output :: Buffer Word8
</span><a href="#local-6989586621679558745"><span class="hs-identifier hs-var">output</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.IO.Buffer.html#Buffer"><span class="hs-identifier hs-type">Buffer</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">bufRaw :: forall e. Buffer e -&gt; RawBuffer e
</span><a href="GHC.IO.Buffer.html#bufRaw"><span class="hs-identifier hs-var">bufRaw</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558744"><span class="annot"><span class="annottext">RawBuffer Word8
</span><a href="#local-6989586621679558744"><span class="hs-identifier hs-var">oraw</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufL :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufL"><span class="hs-identifier hs-var">bufL</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span>   </span><span class="annot"><span class="annottext">bufR :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufR"><span class="hs-identifier hs-var">bufR</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558743"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558743"><span class="hs-identifier hs-var">ow0</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufSize :: forall e. Buffer e -&gt; Int
</span><a href="GHC.IO.Buffer.html#bufSize"><span class="hs-identifier hs-var">bufSize</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621679558742"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558742"><span class="hs-identifier hs-var">os</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-213"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-214"></span><span>      </span><span id="local-6989586621679558738"><span class="annot"><span class="annottext">done :: a -&gt; Int -&gt; Int -&gt; m (a, Buffer Char, Buffer Word8)
</span><a href="#local-6989586621679558738"><span class="hs-identifier hs-var hs-var">done</span></a></span></span><span> </span><span id="local-6989586621679558737"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679558737"><span class="hs-identifier hs-var">why</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679558736"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558736"><span class="hs-identifier hs-var">ir</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679558735"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558735"><span class="hs-identifier hs-var">ow</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a, Buffer Char, Buffer Word8) -&gt; m (a, Buffer Char, Buffer Word8)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679558737"><span class="hs-identifier hs-var">why</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-215"></span><span>                                 </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558736"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558746"><span class="hs-identifier hs-var">iw</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Buffer Char
</span><a href="#local-6989586621679558749"><span class="hs-identifier hs-var">input</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">bufL :: Int
</span><a href="GHC.IO.Buffer.html#bufL"><span class="hs-identifier hs-var">bufL</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bufR :: Int
</span><a href="GHC.IO.Buffer.html#bufR"><span class="hs-identifier hs-var">bufR</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-216"></span><span>                                             </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Buffer Char
</span><a href="#local-6989586621679558749"><span class="hs-identifier hs-var">input</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">bufL :: Int
</span><a href="GHC.IO.Buffer.html#bufL"><span class="hs-identifier hs-var">bufL</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558736"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span>
</span><span id="line-217"></span><span>                                 </span><span class="annot"><span class="annottext">Buffer Word8
</span><a href="#local-6989586621679558745"><span class="hs-identifier hs-var">output</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">bufR :: Int
</span><a href="GHC.IO.Buffer.html#bufR"><span class="hs-identifier hs-var">bufR</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558735"><span class="hs-identifier hs-var">ow</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-218"></span><span>      </span><span id="local-6989586621679558723"><span class="annot"><span class="annottext">loop :: Int -&gt; Int -&gt; IO (CodingProgress, Buffer Char, Buffer Word8)
</span><a href="#local-6989586621679558723"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679558722"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558722"><span class="hs-identifier hs-var">ir</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679558721"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558721"><span class="hs-identifier hs-var">ow</span></a></span></span><span>
</span><span id="line-219"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558721"><span class="hs-identifier hs-var">ow</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558742"><span class="hs-identifier hs-var">os</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingProgress
-&gt; Int -&gt; Int -&gt; IO (CodingProgress, Buffer Char, Buffer Word8)
forall {m :: * -&gt; *} {a}.
Monad m =&gt;
a -&gt; Int -&gt; Int -&gt; m (a, Buffer Char, Buffer Word8)
</span><a href="#local-6989586621679558738"><span class="hs-identifier hs-var">done</span></a></span><span> </span><span class="annot"><span class="annottext">CodingProgress
</span><a href="GHC.IO.Encoding.Types.html#OutputUnderflow"><span class="hs-identifier hs-var">OutputUnderflow</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558722"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558721"><span class="hs-identifier hs-var">ow</span></a></span><span>
</span><span id="line-220"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558722"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558746"><span class="hs-identifier hs-var">iw</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingProgress
-&gt; Int -&gt; Int -&gt; IO (CodingProgress, Buffer Char, Buffer Word8)
forall {m :: * -&gt; *} {a}.
Monad m =&gt;
a -&gt; Int -&gt; Int -&gt; m (a, Buffer Char, Buffer Word8)
</span><a href="#local-6989586621679558738"><span class="hs-identifier hs-var">done</span></a></span><span> </span><span class="annot"><span class="annottext">CodingProgress
</span><a href="GHC.IO.Encoding.Types.html#InputUnderflow"><span class="hs-identifier hs-var">InputUnderflow</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558722"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558721"><span class="hs-identifier hs-var">ow</span></a></span><span>
</span><span id="line-221"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-222"></span><span>           </span><span class="hs-special">(</span><span id="local-6989586621679558720"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679558720"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679558719"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558719"><span class="hs-identifier hs-var">ir'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RawBuffer Char -&gt; Int -&gt; IO (Char, Int)
</span><a href="GHC.IO.Buffer.html#readCharBuf"><span class="hs-identifier hs-var">readCharBuf</span></a></span><span> </span><span class="annot"><span class="annottext">RawBuffer Char
</span><a href="#local-6989586621679558748"><span class="hs-identifier hs-var">iraw</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558722"><span class="hs-identifier hs-var">ir</span></a></span><span>
</span><span id="line-223"></span><span>           </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Int
</span><a href="GHC.Base.html#ord"><span class="hs-identifier hs-var">ord</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679558720"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E"><span class="hs-operator hs-var">&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558750"><span class="hs-identifier hs-var">max_legal_char</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">IO (CodingProgress, Buffer Char, Buffer Word8)
</span><a href="#local-6989586621679558718"><span class="hs-identifier hs-var">invalid</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-224"></span><span>           </span><span class="annot"><span class="annottext">RawBuffer Word8 -&gt; Int -&gt; Word8 -&gt; IO ()
</span><a href="GHC.IO.Buffer.html#writeWord8Buf"><span class="hs-identifier hs-var">writeWord8Buf</span></a></span><span> </span><span class="annot"><span class="annottext">RawBuffer Word8
</span><a href="#local-6989586621679558744"><span class="hs-identifier hs-var">oraw</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558721"><span class="hs-identifier hs-var">ow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Word8
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Int
</span><a href="GHC.Base.html#ord"><span class="hs-identifier hs-var">ord</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679558720"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-225"></span><span>           </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; IO (CodingProgress, Buffer Char, Buffer Word8)
</span><a href="#local-6989586621679558723"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558719"><span class="hs-identifier hs-var">ir'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558721"><span class="hs-identifier hs-var">ow</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-226"></span><span>        </span><span class="hs-keyword">where</span><span>
</span><span id="line-227"></span><span>           </span><span id="local-6989586621679558718"><span class="annot"><span class="annottext">invalid :: IO (CodingProgress, Buffer Char, Buffer Word8)
</span><a href="#local-6989586621679558718"><span class="hs-identifier hs-var hs-var">invalid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodingProgress
-&gt; Int -&gt; Int -&gt; IO (CodingProgress, Buffer Char, Buffer Word8)
forall {m :: * -&gt; *} {a}.
Monad m =&gt;
a -&gt; Int -&gt; Int -&gt; m (a, Buffer Char, Buffer Word8)
</span><a href="#local-6989586621679558738"><span class="hs-identifier hs-var">done</span></a></span><span> </span><span class="annot"><span class="annottext">CodingProgress
</span><a href="GHC.IO.Encoding.Types.html#InvalidSequence"><span class="hs-identifier hs-var">InvalidSequence</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558722"><span class="hs-identifier hs-var">ir</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558721"><span class="hs-identifier hs-var">ow</span></a></span><span>
</span><span id="line-228"></span><span>    </span><span class="hs-keyword">in</span><span>
</span><span id="line-229"></span><span>    </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; IO (CodingProgress, Buffer Char, Buffer Word8)
</span><a href="#local-6989586621679558723"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558747"><span class="hs-identifier hs-var">ir0</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679558743"><span class="hs-identifier hs-var">ow0</span></a></span><span>
</span><span id="line-230"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Latin1.html#single_byte_checked_encode"><span class="hs-pragma hs-type">single_byte_checked_encode</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-231"></span></pre></body></html>